package mi.payment.transaction;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import mi.payment.R;

public class HomePayModeItem extends LinearLayout {

    private TextView mTvName;
    private ImageView mIvIcon;

    public HomePayModeItem(Context context) {
        super(context);
        initView();
    }

    public HomePayModeItem(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initView();
    }

    public HomePayModeItem(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView();
    }

    private void initView() {
        View.inflate(getContext(), R.layout.main_item_pay_mode_lv, this);
        mIvIcon = findViewById(R.id.iv_icon);
        mTvName = findViewById(R.id.tv_name);
    }

    public void setData(int iconRes, String txtStr) {
        mIvIcon.setImageResource(iconRes);
        mTvName.setText(txtStr);
    }

    public void setData(int iconRes, int txtRes) {
        mIvIcon.setImageResource(iconRes);
        mTvName.setText(txtRes);
    }


}
